﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace KursovickCS
{
    [Serializable]
    class String : IObject
    {
        private static string CLASS_NAME = "String";

        private string data = "";

        
        public String(string obj)
        {
            data = obj;
         
        }

        public int Equals(IObject obj)
        {
            String strObj = (String)obj;
            return data.CompareTo(strObj.data);
        }

        public void Sum(IObject obj)
        {
            data += ((String)obj).data;
        }

        public string Name()
        {
            return CLASS_NAME;

        }

        public int Compare(IObject obj)
        {
            return 1;
        }

        public Object UserData()
        {
            return data;
        }

    }
}
